//
//  ACEStudentDetailListCommentController.m
//  ACE
//
//  Created by zhangtao on 2018/8/10.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEStudentDetailListCommentController.h"
#import "CWStarRateView.h"
@interface ACEStudentDetailListCommentController ()<UITextViewDelegate>
@property (weak, nonatomic) IBOutlet CWStarRateView *starView;
@property (weak, nonatomic) IBOutlet UILabel *placeholderLab;
@property (weak, nonatomic) IBOutlet UITextView *textView;
@property (weak, nonatomic) IBOutlet UILabel *unitWordLab;

@end

@implementation ACEStudentDetailListCommentController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"评论";
    self.view.backgroundColor = RGB(244, 244, 244, 1);
    _textView.delegate = self;
    
    UIButton *rightBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 30)];
    [rightBtn setTitle:@"提交" forState:UIControlStateNormal];
    [rightBtn setTitleColor:deepGreen forState:UIControlStateNormal];
    [rightBtn addTarget:self action:@selector(rightClick) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:rightBtn];
    
}

-(void)rightClick{
    NSLog(@"submit");
}

-(BOOL)textViewShouldBeginEditing:(UITextView *)textView{
    _placeholderLab.hidden = YES;
    return YES;
}

-(BOOL)textViewShouldEndEditing:(UITextView *)textView{
    if (textView.text.length<1) {
        _placeholderLab.hidden = NO;
    }
    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
